import { getToken, setToken, delToken } from '@/utils/storage'
export default {
  namespaced: true,
  state () {
    return {
      token: getToken(),
      userName: 'admin'
    }
  },
  mutations: {
    setUserToken (state, payload) {
      state.token = payload.token
      state.userName = payload.userName
      setToken(payload.token)
    },
    logout (state) {
      state.token = null
      delToken()
    }
  },
  getters: {

  },
  actions: {
  }
}
